package java_demos.java_io.file_path;

import java.io.File;
import java.io.IOException;

public class FilePathEmp {
    public static void main(String[] args) {

        try {
            String filename = "create_file_filepathemp.txt";

            String dir = System.getProperty("user.dir");
            System.out.println("Current directory: " + dir);
            String absoluteaPath = dir + File.separator + filename;
            File file = new File(absoluteaPath);
            if(file.createNewFile()){
                System.out.println("File created successfully: " + file.getName());
            } else {
                System.out.println("File already exists: " + file.getName());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
